<template>
	<!-- 结构 -->
	<button @tap="sayHi('翻滚吧牛宝宝')">我是个按钮</button>
	<button @tap="count++">count {{ count }}</button>
	<button @tap="sub">递减 count</button>
	<view class="item" v-for="(item, index) in list" @tap="removeItem(index)">
		{{ index + item }}
	</view>
	<!-- 测试内置组件 -->
	<swiper
		:indicator-dots="true"
		:autoplay="true"
		:interval="3000"
		:duration="1000"
		circular=""
	>
		<swiper-item>
			<view class="swiper-item">A</view>
		</swiper-item>
		<swiper-item>
			<view class="swiper-item">B</view>
		</swiper-item>
	</swiper>
	<!-- <ad-rewarded-video></ad-rewarded-video> -->
	<map
		style="width: 100%; height: 300px"
		:latitude="latitude"
		:longitude="longitude"
		:markers="covers"
	>
	</map>
	<video
		src="https://cn-hbyc-ct-02-12.bilivideo.com/upgcxcode/95/11/981221195/981221195_nb3-1-16.mp4?e=ig8euxZM2rNcNbRVhwdVhwdlhWdVhwdVhoNvNC8BqJIzNbfq9rVEuxTEnE8L5F6VnEsSTx0vkX8fqJeYTj_lta53NCM=&uipk=5&nbs=1&deadline=1730437983&gen=playurlv2&os=bcache&oi=1948154174&trid=0000d95ef1db45084aeea5d3d68cdbd51835h&mid=17440817&platform=html5&og=cos&upsig=b75801b8ad095c41386438cab32222dc&uparams=e,uipk,nbs,deadline,gen,os,oi,trid,mid,platform,og&cdnid=7280&bvc=vod&nettype=0&f=h_0_0&bw=16018&logo=80000000"
	></video>
</template>

<script setup>
	import { ref } from 'vue'

	// 定义状态变量
	const count = ref(10)

	const list = ref(['西兰花', '西葫芦', '西红柿'])

	// 逻辑
	const sayHi = (data) => {
		console.log('么么哒', data)
	}
	const sub = () => {
		count.value--
	}
	const removeItem = (index) => {
		console.log(index)
		list.value.splice(index, 1)
	}
</script>

<style>
	/* 样式 */
	.item {
		background-color: skyblue;
		margin: 10rpx;
		text-align: center;
		padding: 20rpx;
	}
</style>
